#! /usr/bin/env python
# -*- coding: UTF-8 -*-
'''方便execl文件处理的命令行工具
'''
import os
import sys
from pathlib import Path
import pdb
import logging

# 设置包搜索路径
__p = Path(__file__).parent
sys.path.append(str(__p))

from py_lib.logger_utils import logger_init
from py_lib.my_exception import MyException
from py_lib.excel_tool.arg_parser.main_arg_parser import MainArgParser

def main():
    # 分析命令行参数
    parser = MainArgParser('execl_tool.py', 'Excel命令行工具').get_parser()
    args, restArgv = parser.parse_known_args()

    # 设置日志
    logger_init(args.verbosity)
    global logger
    logger = logging.getLogger(__name__)

    logger.debug('main entry')

if __name__ == '__main__':
    try:
        main()
    except MyException as e:
        print(e)
